﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using EasyLucky.Message.Messages;
using EasyLucky.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace EasyLucky.ViewModels
{
    public class IndexViewModel:ObservableObject
    {

        private string luckyTitle;

        public string LuckyTitle
        {
            get { return luckyTitle; }
            set { SetProperty(ref luckyTitle, value); }
        }

        public IndexViewModel()
        {
            this.LuckyTitle = AppConfig.GetStringValue("Title", string.Empty);
        }


        private IRelayCommand startCommand;

        public IRelayCommand StartCommand
        {
            get { return startCommand ??= new RelayCommand(Start); }
        }

        private void Start()
        {
            WeakReferenceMessenger.Default.Send(new StateChangedMessage(1));
        }
    }
}
